﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Routing;
using MvcContrib.TestHelper;
using NUnit.Framework;
using WWB.SitePointPrivateMessages.Web.Controllers;

namespace WWB.SitePointPrivateMessages.Web.Tests.InfrastructureTests
{
    [TestFixture]
    public class RouteTests
    {
        [SetUp]
        public void SetupRouteTable()
        {
            RouteTable.Routes.Clear();
            SitePointPrivateMessagesWebApp.RegisterRoutes(RouteTable.Routes);
        }

        [Test]
        public void Verify_messagereading()
        {
            "~/Messages".Route().ShouldMapTo<MessagesController>(x => x.Index(null));
            "~/Messages/Message/MESSAGEID".Route().ShouldMapTo<MessagesController>(x => x.Message("MESSAGEID"));
        }

        [Test]
        public void Verify_messagewriting()
        {
            "~/Messages/ImportMessages".Route().ShouldMapTo<MessagesController>(x => x.ImportMessages(null, null));
        }
    }
}
